<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: 12701
  Date: 2024/9/2
  Time: 9:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Medicamp Responsive Bootstrap Template">
    <meta name="keywords" content="Pixel">
    <meta name="author" content="rkwebdesigns">
    <title>挂号</title>
    <link href="${pageContext.request.contextPath}/static/css/css_wjh/css_wjh1/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/css/css_wjh/css_wjh1/bootstrap-dropdownhover.min.css" rel="stylesheet">
    <!-- Fonts Awesome -->
    <link href="${pageContext.request.contextPath}/static/css/css_wjh/css_wjh1/font-awesome.min.css" rel="stylesheet">
    <!-- Google Fonts -->
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,800italic,800,600italic,600,400italic,700,700italic' rel='stylesheet' type='text/css'>
    <!-- animate Effect -->
    <link href="${pageContext.request.contextPath}/static/css/css_wjh/css_wjh1/animate.css" rel="stylesheet">
    <!-- Main CSS -->
    <link href="${pageContext.request.contextPath}/static/css/css_wjh/css_wjh1/style.css" rel="stylesheet">
    <!-- Responsive CSS -->
    <link href="${pageContext.request.contextPath}/static/css/css_wjh/css_wjh1/responsive.css" rel="stylesheet">
</head>
<body>
<header id="header" class="head">
    <div class="top-header" style="background: #00acd6">
        <div class="container">
            <div class="row ">
                <ul class="contact-detail2 col-md-6 pull-left">
                    <li> <i class="fa fa-mobile" style="color: white"></i><font color="white">联系我们 +86 4004008299 </font></li>
                </ul>
                <div class="social-links col-md-6 pull-right">
                    <ul class="social-icons pull-right">
                        <li> <i class="fa fa-envelope-o" style="color: white"></i><font color="white"> yiliaojiankang@gmail.com </font></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <nav class="navbar navbar-default navbar-menu">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="">
                    <div class="logo-text"><span><samp>医</samp>医疗</span>健康系统</div>
                </a>
            </div>
            <form action="${pageContext.request.contextPath}/doctorInfo/parseId.do?id=${id}" method="post">
                <input type="hidden" name="id" value="${id}">
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" data-hover="dropdown" data-animations="fadeIn">
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="${pageContext.request.contextPath}/doctorInfo/parseId.do?id=${id}">首页</a></li>
                        <li><a href="${pageContext.request.contextPath}/plan/findAllPai2.do?id=${id}">排班</a></li>
                        <li><a href="${pageContext.request.contextPath}/doctor/docexam.do?id=${id}">体检</a></li>
                        <li><a href="${pageContext.request.contextPath}/register/findDoctorById.do?id=${id}">挂号</a></li>
                        <li><a href="${pageContext.request.contextPath}/">咨询</a></li>
                        <li><a href="${pageContext.request.contextPath}/messageList/messageFindAll4.do">公告</a></li>
                        <li><a href="${pageContext.request.contextPath}/doctorInfo/findDoctorById.do?id=${id}">个人中心</a></li>
                    </ul>
                </div>
            </form>
        </div>
    </nav>
</header>
<section id="inner-title" class="inner-title">
    <div class="container">
        <div class="row">
            <div class="col-md-6 col-lg-6"><h2>挂号</h2></div>
            <div class="col-md-6 col-lg-6">
                <div class="breadcrumbs">
                    <ul>
                        <li>当前页:</li>
                        <li><a href="">挂号</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</section>
<section id="section18" class="section-margine">
    <div class="container">
        <div class="section18">
            <div class="row">

                <!-- .box-body -->
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">挂号记录</h3>
                    </div>

                    <div class="box-body">

                        <!-- 数据表格 -->
                        <div class="table-box">


                            <div class="pull-left">
                                <div class="form-group form-inline">
                                    <div class="btn-group">
                                        <button type="button" class="btn btn-default" onclick="toExportRecords()"><i class="fa fa-file-o"></i> 查看档案</button>
                                    </div>
                                </div>
                            </div>
                            <div class="box-tools pull-right">
                                <form  id="f1" action="${pageContext.request.contextPath}/register/doctorFindAll.do" method="post">
                                    <input type="text" name="records_number" value="${records_number}"  placeholder="请输入病历单号...">
                                    <input type="text" name="user_name" value="${user_name}" placeholder="请输入患者姓名...">
                                    <input type="hidden" name="doctorId" id="doctorId" value="${doctor_id}">
                                    <input type="hidden" name="pageNum" id="pc" value="${page.pageNum}">
                                    <input type="hidden" name="pageSize" id="ps" value="${page.pageSize}">
                                    <input type="submit" value="查询">
                                </form>
                            </div>
                            <!--工具栏/-->

                            <!--数据列表-->
                            <table id="dataList" class="table table-bordered table-striped table-hover dataTable">
                                <thead>
                                <tr>
                                    <th class="text-center" style="padding-right:0px;">
                                        <input id="selall" type="checkbox" class="icheckbox_square-blue" onclick="qx()">
                                    </th>
                                    <th class="text-center sorting">病例单号</th>
                                    <th class="text-center sorting">患者姓名</th>
                                    <th class="text-center sorting">患者性别</th>
                                    <th class="text-center sorting">患者年龄</th>
                                    <th class="text-center sorting">预约日期</th>
                                    <th class="text-center sorting">是否就诊</th>
                                    <th class="text-center sorting">签到状态</th>
                                    <th class="text-center sorting">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach var="record" items="${page.list}">
                                    <tr>
                                        <td class="text-center">
                                            <input type="checkbox" name="cks" value="${record.id}">
                                        </td>
                                        <td class="text-center">${record.records_number}</td>
                                        <td class="text-center">${record.user_name}</td>
                                        <td class="text-center">${record.user_sex}</td>
                                        <td class="text-center">${record.user_age}</td>
                                        <td class="text-center">
                                            <fmt:formatDate value="${record.date}" pattern="yyyy-MM-dd"/>
                                        </td>
                                        <td class="text-center">${record.seek}</td>
                                        <td class="text-center">${record.status}</td>
                                        <td class="text-center">
                                            <button type="button" class="btn bg-olive btn-xs" onclick="toThisRecord(${record.id})">查看</button>
                                        </td>
                                    </tr>
                                </c:forEach>


                                </tbody>

                            </table>
                            <!--数据列表/-->



                        </div>
                        <!-- 数据表格 /-->


                    </div>
                    <!-- /.box-body -->

                    <!-- .box-footer-->

                    <%--                            分页--%>
                    <div class="box-footer">
                        <div class="pull-left">
                            <div class="form-group form-inline">
                                当前第${page.pageNum}页/总共 ${page.pages} 页，共${page.total} 条数据。 每页
                                <select class="form-control" id="pageSize">
                                    <option value="1" ${page.pageSize==1?'selected=selected':''}>1</option>
                                    <option value="2" ${page.pageSize==2?'selected=selected':''}>2</option>
                                    <option value="3"  ${page.pageSize==3?'selected=selected':''}>3</option>
                                    <option value="4" ${page.pageSize==4?'selected=selected':''}>4</option>
                                    <option value="5" ${page.pageSize==5?'selected=selected':''}>5</option>
                                </select> 条
                            </div>
                        </div>

                        <div class="box-tools pull-right">
                            <ul class="pagination">
                                <li>
                                    <a href="javascript:go(1)" aria-label="Previous">首页</a>
                                </li>
                                <c:if test="${page.hasPreviousPage}">
                                    <li><a href="javascript:go(${page.prePage})">上一页</a></li>
                                </c:if>

                                <c:choose>
                                    <c:when test="${page.pages<=5}">
                                        <c:set var="begin" value="1"/>
                                        <c:set var="end" value="${page.pages}"/>
                                    </c:when>
                                    <c:otherwise>
                                        <c:set var="begin" value="${page.pageNum-3}"/>
                                        <c:set var="end" value="${page.pageNum+2}"/>
                                        <c:if test="${begin<1}">
                                            <c:set var="begin" value="1"/>
                                            <c:set var="end" value="5"/>
                                        </c:if>
                                        <c:if test="${end > page.pages}">
                                            <c:set var="begin" value="${page.pages-9}"/>
                                            <c:set var="end" value="${page.pages}"/>
                                        </c:if>
                                    </c:otherwise>
                                </c:choose>
                                <c:forEach var="i" begin="${begin}" end="${end}">
                                    <li>
                                        <c:choose>
                                            <c:when test="${page.pageNum eq i}">
                                                <span>${i}</span>
                                            </c:when>
                                            <c:otherwise>
                                                <a href="javascript:go(${i});">${i}</a>
                                            </c:otherwise>
                                        </c:choose>
                                    </li>
                                </c:forEach>


                                <c:if test="${page.hasNextPage}">
                                    <li><a href="javascript:go(${page.nextPage})">下一页</a></li>
                                </c:if>

                                <li>
                                    <a href="javascript:go(${page.pages})" aria-label="Next">尾页</a>
                                </li>
                            </ul>
                        </div>

                    </div>
                    <!-- /.box-footer-->



                </div>


            </div>
        </div>
    </div>
</section>



<section id="section10" class="section-10-background">
    <div class="container">
        <div class="row">
            <div class="col-md-9 col-lg-9">
                <div class="section-10-box-text-cont">
                    <h3>We Are Ready to Check Your Health,<span class="color-yellow">  Call : +86-400-400-8299</span></h3>
                </div>
            </div>
        </div>
    </div>
</section>
<section id="footer-bottom" class="footer-bottom">
    <div class="container">
        <div class="row">
            <div class="col-md-9 col-lg-9">
                <div class="copyright">Copyright &copy; 2024.Company name All rights reserved.</div>
            </div>
        </div>
    </div>
</section>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/jquery.plugin.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/jquery.isotope.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/jquery.magnific-popup.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/bootstrap-dropdownhover.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/wow.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/waypoints.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/jquery.counterup.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/main.js"></script>


<script src="${pageContext.request.contextPath}/static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/jQueryUI/jquery-ui.min.js"></script>
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/raphael/raphael-min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/morris/morris.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/sparkline/jquery.sparkline.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/knob/jquery.knob.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/daterangepicker/moment.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/daterangepicker/daterangepicker.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/fastclick/fastclick.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/iCheck/icheck.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/adminLTE/js/app.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/treeTable/jquery.treetable.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/select2/select2.full.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-markdown/js/markdown.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-markdown/js/to-markdown.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/ckeditor/ckeditor.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/input-mask/jquery.inputmask.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/chartjs/Chart.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/flot/jquery.flot.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/flot/jquery.flot.resize.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/flot/jquery.flot.pie.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/flot/jquery.flot.categories.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/ionslider/ion.rangeSlider.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-slider/bootstrap-slider.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script>
    $(document).ready(function() {

    });

    function toThisRecord(id) {
        window.location.href="${pageContext.request.contextPath}/register/toFillRecord.do?id="+id;
    }
    function toExportRecords() {
        window.location.href="${pageContext.request.contextPath}/doctor/findAllRecords.do";
    }


    function go(pageNum) {
        $("#pc").val(pageNum);
        var pageSize = $("#pageSize option:selected").val();
        $("#ps").val(pageSize);
        $("#f1").submit();


    }
    $("#pageSize").change(function () {
        var pageSize = $("#pageSize option:selected").val();
        $("#ps").val(pageSize);
        $("#pc").val(${page.pageNum});
        $("#f1").submit();
    })

    $("#toUpd").click(function () {
        <%--window.location.href="${pageContext.request.contextPath}/jsp/updateRegister.jsp";--%>
        window.location.href="${pageContext.request.contextPath}/register/findDoctorAndPatientBuId.do";

    })

    function qx(){
        var cks = document.getElementsByName("cks");
        var allChecked = true;

        for (var i = 0; i < cks.length; i++) {
            if (!cks[i].checked) {
                allChecked = false;
                break;
            }
        }

        for (var i = 0; i < cks.length; i++) {
            cks[i].checked = !allChecked;
        }
    }

</script>
</body>
</html>
